import { ElementPlusResolverOptions } from "unplugin-vue-components/resolvers";

const CustomComponent = (options: ElementPlusResolverOptions) => {
    return (componentName: string) => {
        if (componentName.startsWith("Xc")) {
            const name = componentName.slice(2).toLowerCase();
            return {
                ...options,
                name,
                from: `@/components/${name}`,
                sideEffects: `@/theme-chalk/src/${name}.less`
            }
        }
    };
};

export default CustomComponent;
